package com.itcast.es.dao;

import com.itcast.es.domain.Goods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author StarsOfFuture_xYang
 * @version 1.0
 * @date 2021-04-29 11:02 下午
 * @information Springboot-Es - com.itcast.es.dao
 **/
@Mapper
@Repository
public interface GoodsMapper {

    @Select("select * from goods")
    @Results(id="goods",value = {
            @Result(column = "id",property = "id"),
            @Result(column = "title",property = "title"),
            @Result(column = "price",property = "price"),
            @Result(column = "stock",property = "stock"),
            @Result(column = "saleNum",property = "saleNum"),
            @Result(column = "createTime",property = "createTime"),
            @Result(column = "categoryName",property = "categoryName"),
            @Result(column = "brandName",property = "brandName"),
            @Result(column = "spec",property = "specStr")
    })
//    @ResultMap(value = "goods")
    List<Goods> findAll();
}
